﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace l1cs.server.serverpackets
{
    public class S_Ability : ServerBasePacket
    {
        private static Logger _log = Logger.getLogger( typeof( S_Ability ).FullName );

        private byte[] _byte = null;

        public S_Ability( int type, bool equipped )
        {
            buildPacket( type, equipped );
        }

        private void buildPacket( int type, bool equipped )
        {
            writeC( Opcodes.S_OPCODE_ABILITY );
            writeC( type ); // 1:ROTC 5:ROSC
            if ( equipped )
            {
                writeC( 0x01 );
            }
            else
            {
                writeC( 0x00 );
            }
            writeC( 0x02 );
            writeH( 0x0000 );
        }

        override
        public byte[] getContent()
        {
            if ( _byte == null )
            {
                _byte = getBytes();
            }
            return _byte;
        }

        override
        public String getType()
        {
            return "[S] S_Ability";
        }
    }
}
